using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class gal_airlineMap : EntityTypeConfiguration<gal_airline>
    {
        public gal_airlineMap()
        {
            // Primary Key
            this.HasKey(t => t.id);

            // Properties
            this.Property(t => t.SectionString)
                .HasMaxLength(500);

            this.Property(t => t.SECTION_LABEL)
                .IsFixedLength()
                .HasMaxLength(3);

            this.Property(t => t.Segment_Number)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.AIRLINE_CODE)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.AIRLINE_NUMBER)
                .IsFixedLength()
                .HasMaxLength(3);

            this.Property(t => t.AIRLINE_NAME)
                .IsFixedLength()
                .HasMaxLength(12);

            this.Property(t => t.FLIGHT_NUMBER)
                .IsFixedLength()
                .HasMaxLength(4);

            this.Property(t => t.CLASS_OF_SERVICE)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.STATUS)
                .IsFixedLength()
                .HasMaxLength(2);

            this.Property(t => t.DEPARTURE_DATE)
                .IsFixedLength()
                .HasMaxLength(5);

            this.Property(t => t.DEPARTURE_TIME)
                .IsFixedLength()
                .HasMaxLength(5);

            this.Property(t => t.ARRIVAL_TIME)
                .IsFixedLength()
                .HasMaxLength(5);

            this.Property(t => t.NEXT_DAY_ARRIVAL_INDICATOR)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.ORIGIN_CITY_CODE)
                .IsFixedLength()
                .HasMaxLength(3);

            this.Property(t => t.ORIGIN_CITY_NAME)
                .IsFixedLength()
                .HasMaxLength(13);

            this.Property(t => t.DESTINATION_CITY_CODE)
                .IsFixedLength()
                .HasMaxLength(3);

            this.Property(t => t.DESTINATION_CITY_NAME)
                .IsFixedLength()
                .HasMaxLength(13);

            this.Property(t => t.DOMESTIC_INTERNATIONAL_INDICATOR)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.SEAT_INDICATOR)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.MEAL_CODES)
                .IsFixedLength()
                .HasMaxLength(4);

            this.Property(t => t.STOPOVER_INDICATORS)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.NUMBER_OF_STOPS)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.BAGGAGE_ALLOWANCE)
                .IsFixedLength()
                .HasMaxLength(3);

            this.Property(t => t.TYPE_OF_AIRCRAFT)
                .IsFixedLength()
                .HasMaxLength(4);

            this.Property(t => t.DEPARTURE_TERMINAL)
                .IsFixedLength()
                .HasMaxLength(3);

            this.Property(t => t.NAUTICAL_MILES)
                .IsFixedLength()
                .HasMaxLength(5);

            this.Property(t => t.FLIGHT_COUPON_INDICATOR)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.SEGMENT_IDENTIFIER)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.CHANGE_OF_GAUGE_ID)
                .IsFixedLength()
                .HasMaxLength(4);

            this.Property(t => t.INTERMEDIATE_CITY_CODE)
                .IsFixedLength()
                .HasMaxLength(3);

            this.Property(t => t.INTERMEDIATE_CITY_NAME)
                .IsFixedLength()
                .HasMaxLength(13);

            this.Property(t => t.NEXT_DAY_ARRIVAL_INDICATOR1)
                .IsFixedLength()
                .HasMaxLength(1);

            this.Property(t => t.DEPARTURE_TIME_FROM)
                .IsFixedLength()
                .HasMaxLength(5);

            // Table & Column Mappings
            this.ToTable("gal_airline");
            this.Property(t => t.id).HasColumnName("id");
            this.Property(t => t.reference).HasColumnName("reference");
            this.Property(t => t.SectionString).HasColumnName("SectionString");
            this.Property(t => t.MIR).HasColumnName("MIR");
            this.Property(t => t.SECTION_LABEL).HasColumnName("SECTION LABEL");
            this.Property(t => t.Segment_Number).HasColumnName("Segment Number");
            this.Property(t => t.AIRLINE_CODE).HasColumnName("AIRLINE CODE");
            this.Property(t => t.AIRLINE_NUMBER).HasColumnName("AIRLINE NUMBER");
            this.Property(t => t.AIRLINE_NAME).HasColumnName("AIRLINE NAME");
            this.Property(t => t.FLIGHT_NUMBER).HasColumnName("FLIGHT NUMBER");
            this.Property(t => t.CLASS_OF_SERVICE).HasColumnName("CLASS OF SERVICE");
            this.Property(t => t.STATUS).HasColumnName("STATUS");
            this.Property(t => t.DEPARTURE_DATE).HasColumnName("DEPARTURE DATE");
            this.Property(t => t.DEPARTURE_TIME).HasColumnName("DEPARTURE TIME");
            this.Property(t => t.ARRIVAL_TIME).HasColumnName("ARRIVAL TIME");
            this.Property(t => t.NEXT_DAY_ARRIVAL_INDICATOR).HasColumnName("NEXT DAY ARRIVAL INDICATOR");
            this.Property(t => t.ORIGIN_CITY_CODE).HasColumnName("ORIGIN CITY CODE");
            this.Property(t => t.ORIGIN_CITY_NAME).HasColumnName("ORIGIN CITY NAME");
            this.Property(t => t.DESTINATION_CITY_CODE).HasColumnName("DESTINATION CITY CODE");
            this.Property(t => t.DESTINATION_CITY_NAME).HasColumnName("DESTINATION CITY NAME");
            this.Property(t => t.DOMESTIC_INTERNATIONAL_INDICATOR).HasColumnName("DOMESTIC/INTERNATIONAL INDICATOR");
            this.Property(t => t.SEAT_INDICATOR).HasColumnName("SEAT INDICATOR");
            this.Property(t => t.MEAL_CODES).HasColumnName("MEAL CODES");
            this.Property(t => t.STOPOVER_INDICATORS).HasColumnName("STOPOVER INDICATORS");
            this.Property(t => t.NUMBER_OF_STOPS).HasColumnName("NUMBER OF STOPS");
            this.Property(t => t.BAGGAGE_ALLOWANCE).HasColumnName("BAGGAGE ALLOWANCE");
            this.Property(t => t.TYPE_OF_AIRCRAFT).HasColumnName("TYPE OF AIRCRAFT");
            this.Property(t => t.DEPARTURE_TERMINAL).HasColumnName("DEPARTURE TERMINAL");
            this.Property(t => t.NAUTICAL_MILES).HasColumnName("NAUTICAL MILES");
            this.Property(t => t.FLIGHT_COUPON_INDICATOR).HasColumnName("FLIGHT COUPON INDICATOR");
            this.Property(t => t.SEGMENT_IDENTIFIER).HasColumnName("SEGMENT IDENTIFIER");
            this.Property(t => t.CHANGE_OF_GAUGE_ID).HasColumnName("CHANGE OF GAUGE ID");
            this.Property(t => t.INTERMEDIATE_CITY_CODE).HasColumnName("INTERMEDIATE CITY CODE");
            this.Property(t => t.INTERMEDIATE_CITY_NAME).HasColumnName("INTERMEDIATE CITY NAME");
            this.Property(t => t.NEXT_DAY_ARRIVAL_INDICATOR1).HasColumnName("NEXT DAY ARRIVAL INDICATOR1");
            this.Property(t => t.DEPARTURE_TIME_FROM).HasColumnName("DEPARTURE TIME FROM");
            this.Property(t => t.departure_date1).HasColumnName("departure_date");
        }
    }
}
